package com.cn.web.app.template.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cn.web.app.template.entity.OrderTemplateEntity;
import com.cn.web.app.template.vo.OrderTemplateListVO;
import com.cn.web.app.template.vo.OrderTemplateSearch;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * description: IOrderTemplateMapper <br>
 * date: 24.7.9 17:08 <br>
 * author: cn_yaojin <br>
 * version: 1.0 <br>
 */
@Mapper
public interface IOrderTemplateMapper extends BaseMapper<OrderTemplateEntity> {

    @Select("select o1.*,u1.user_name,u2.org_name  from order_template o1,sys_user u1,sys_unit u2 " +
            "where o1.user_id=u1.id and o1.org_id=u2.id  " +
            "and ${ew.sqlSegment}")
    List<OrderTemplateListVO> list(@Param(value = "ew") QueryWrapper<OrderTemplateSearch> ew);

}
